﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cronos.DateTimeExtensions
{
    public static class MonthExtensions
    {
        public static DateTime FirstDayOfMonth(this DateTime source)
        {
            return source.AddDays((source.Day - 1) * -1);
        }

        public static DateTime LastDayOfMonth(this DateTime source)
        {
            return source.AddMonths(1).FirstDayOfMonth().AddDays(-1);
        }
    }
}